<template>
  <div>
    <Header :title="title"></Header>
    <p>从Child组件获得的玩具: {{ fromChildToy }}</p>

    <CustomEventChildCompound @send-toy="getToy"></CustomEventChildCompound>
  </div>
</template>
<script lang="ts" setup>
import CustomEventChildCompound from '@/components/passvalue/CustomEventChildCompound.vue';
import { ref } from 'vue';
import Header from '@/components/Header.vue';
const title = "自定义事件传递值"
const fromChildToy = ref<string>("");

function getToy(toy: string) {
  fromChildToy.value = toy
}
</script>
<style lang="scss" scoped></style>
